<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="../css/pintuer.css">
    <link rel="stylesheet" href="../css/admin.css">
    <script src="../js/jquery.js"></script>
    <script src="../js/pintuer.js"></script>
</head>
<body>
<form method="get" action="" id="listform">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 会议室列表</strong>
            <a href="" style="float:right; display:none;">添加字段</a></div>
        <div class="padding border-bottom">
            <ul class="search" style="padding-left:10px;">


                <li> <a class="button border-main icon-plus-square-o" href="boardroomAdd.jsp"> 添加会议室</a> </li>
                <%--<li>搜索：</li>
                <li>首页
                    <select name="s_ishome" class="input" onchange="changesearch()" style="width:60px; line-height:17px; display:inline-block">
                        <option value="">选择</option>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                    &nbsp;&nbsp;
                    推荐
                    <select name="s_isvouch" class="input" onchange="changesearch()"  style="width:60px; line-height:17px;display:inline-block">
                        <option value="">选择</option>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                    &nbsp;&nbsp;
                    置顶
                    <select name="s_istop" class="input" onchange="changesearch()"  style="width:60px; line-height:17px;display:inline-block">
                        <option value="">选择</option>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                </li>
                <if condition="$iscid eq 1">
                    <li>
                        <select name="cid" id="leixing" class="input" style="width:200px; line-height:17px;" >
                            &lt;%&ndash;<option value="kong">请选择查询依据</option>
                            <option value="name">按名字查询</option>
                            <option value="id">按id查询</option>
                            <option value="salary">按薪资查询</option>
                            <option value="worktime">按时间查询</option>
                            <option value="communist">查询党员</option>&ndash;%&gt;
                        </select>
                    </li>
                </if>
                <li>

                    <input type="text" id="gjz" placeholder="请输入搜索关键字" name="keywords" class="input" style="width:250px; line-height:17px;display:inline-block" />
                    <a href="javascript:void(0)" class="button border-main icon-search" onclick="changesearch()" > 搜索</a>

                </li>
--%>
            </ul>
        </div>
        <table class="table table-hover text-center">
            <tr>
                <th width="100" style="text-align:left; padding-left:20px;">会议室ID</th>
                <th >会议室名</th>
                <th>可容纳人数</th>
                <%--                <th >会议室当前状态</th>--%>
                <th width="310">操作</th>
            </tr>
            <volist name="list" id="vo">

                <c:forEach items="${pb.list}" var="boardr" >
                <tr>
                    <td style="text-align:left; padding-left:20px;">
                        <input type="checkbox" name="id[]" value="" />
                            ${boardr.id}
                    </td>
                    <td ><span  alt="" width="70" height="50" >${boardr.boardRoomName}</span></td>
                    <td><span  alt="" width="70" height="50" >${boardr.maxNumber}</span></td>
                        <%--                    <td>${boardr.state}</td>--%>

                    <td><div class="button-group">

                        <a class="button border-main" href="BoardroomServlet?flag=3&id=${boardr.id}">
                            <span class="icon-edit"></span> 修改</a>
                        <a class="button border-red" href="BoardroomServlet?flag=5&id=${boardr.id}">
                            <span class="icon-trash-o"></span> 删除</a>
                    </div></td>
                </tr>

                </c:forEach>




                <c:if test="${pb.currentPage == 1}">
                <tr>
                    <td colspan="8">
                        <div class="pagelist">
                            一共有 ${pb.totalCount} 条数据,共${pb.totalPage}页
                            <a href="BoardroomServlet?flag=1&page=1">首页</a>
                            <span class="current" style="background-color: #bbbbbb;border: 0px">上一页</span>
                            <span class="current">${pb.currentPage}</span>
                            <a href="BoardroomServlet?flag=1&page=${pb.currentPage+1}">${pb.currentPage+1}</a>
                            <a href="BoardroomServlet?flag=1&page=${pb.currentPage+2}">${pb.currentPage+2}</a>
                            <a href="BoardroomServlet?flag=1&page=${pb.currentPage+1}">下一页</a>
                            <a href="BoardroomServlet?flag=1&page=${pb.totalPage}">尾页</a>
                        </div></td>
                </tr>
                </c:if>
                <c:if test="${pb.currentPage == pb.totalPage && pb.currentPage != 1}">
                <tr>
                    <td colspan="8">
                        <div class="pagelist">
                            一共有 ${pb.totalCount} 条数据,共${pb.totalPage}页
                            <a href="BoardroomServlet?flag=1&page=1">首页</a>
                            <a href="BoardroomServlet?flag=1&page=${pb.currentPage-1}">上一页</a>
                            <a href="BoardroomServlet?flag=1&page=${pb.currentPage-1}">${pb.currentPage-1}</a>
                            <span class="current">${pb.currentPage}</span>
                            <span class="current" style="background-color: #bbbbbb;border: 0px">下一页</span>
                            <a href="BoardroomServlet?flag=1&page=${pb.totalPage}">尾页</a>
                        </div></td>
                </tr>
                </c:if>
                <c:if test="${pb.currentPage != 1 && pb.currentPage != pb.totalPage && pb.totalPage != 1}">
                <tr>
                    <td colspan="8">
                        <div class="pagelist">
                            一共有 ${pb.totalCount} 条数据,共${pb.totalPage}页
                            <a href="BoardroomServlet?flag=1&page=1">首页</a>
                            <a href="BoardroomServlet?flag=1&page=${pb.currentPage-1}">上一页</a>
                            <a href="BoardroomServlet?flag=1&page=${pb.currentPage-1}">${pb.currentPage-1}</a>
                            <span class="current">${pb.currentPage}</span>
                            <a href="BoardroomServlet?flag=1&page=${pb.currentPage+1}">${pb.currentPage+1}</a>
                            <a href="BoardroomServlet?flag=1&page=${pb.currentPage+1}">下一页</a>
                            <a href="BoardroomServlet?flag=1&page=${pb.totalPage}">尾页</a>
                        </div></td>
                </tr>
                </c:if>


        </table>
    </div>
</form>
<script type="text/javascript">

    //搜索
    function changesearch(){
        var leixing=$("#leixing").val();
        var gjz=1;
        if($("#leixing"!=kong)){
            gjz=$("#gjz").val();
        }

        console.log("jsp  leixing:"+leixing+"  GJZ:"+gjz);
        location.href="SelectByTservlet?cid="+leixing+"keywords="+gjz;
    }

    //单个删除
    function del(id,mid,iscid){
        if(confirm("您确定要删除吗?")){

        }
    }

    //全选
    $("#checkall").click(function(){
        $("input[name='id[]']").each(function(){
            if (this.checked) {
                this.checked = false;
            }
            else {
                this.checked = true;
            }
        });
    })

    //批量删除
    function DelSelect(){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){
            var t=confirm("您确认要删除选中的内容吗？");
            if (t==false) return false;
            $("#listform").submit();
        }
        else{
            alert("请选择您要删除的内容!");
            return false;
        }
    }

    //批量排序
    function sorts(){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){

            $("#listform").submit();
        }
        else{
            alert("请选择要操作的内容!");
            return false;
        }
    }


    //批量首页显示
    function changeishome(o){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){

            $("#listform").submit();
        }
        else{
            alert("请选择要操作的内容!");

            return false;
        }
    }

    //批量推荐
    function changeisvouch(o){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){


            $("#listform").submit();
        }
        else{
            alert("请选择要操作的内容!");

            return false;
        }
    }

    //批量置顶
    function changeistop(o){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){

            $("#listform").submit();
        }
        else{
            alert("请选择要操作的内容!");

            return false;
        }
    }


    //批量移动
    function changecate(o){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){

            $("#listform").submit();
        }
        else{
            alert("请选择要操作的内容!");

            return false;
        }
    }

    //批量复制
    function changecopy(o){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){
            var i = 0;
            $("input[name='id[]']").each(function(){
                if (this.checked==true) {
                    i++;
                }
            });
            if(i>1){
                alert("只能选择一条信息!");
                $(o).find("option:first").prop("selected","selected");
            }else{

                $("#listform").submit();
            }
        }
        else{
            alert("请选择要复制的内容!");
            $(o).find("option:first").prop("selected","selected");
            return false;
        }
    }

</script>
</body>
</html>

